var self;
mui.init();
hui.plusReady(function() {
	self = plus.webview.currentWebview();
	ajaxData(self.newID, self.tableNum);
	hui('#hui-back').click(function(){
		hui.Back();
	})
});

function ajaxData(id, tableNum) {
	hui.ajax({
		url: 'http://api.dagoogle.cn/news/single-news?news_id=' + id + '&tableNum=' + tableNum,
		backType: 'JSON',
		beforeSend: function() {
			hui.loading();
		},
		complete: function() {
			hui.closeLoading();
		},
		success: function(msg) {
			console.log(JSON.stringify(msg));
			if(msg.status == 200) {
				hui('#newTitle').html(msg.data.title);
				hui('#content').html(msg.data.content);
			} else {
				hui.iconToast('读取消息失败', 'warn');
			}
		},
		error: function(e) {
			console.log(JSON.stringify(e));
			hui.iconToast('读取消息失败', 'warn');
		}
	});
}